﻿package view.selectView
{
    import com.core.*;

    public class SelectViewControl extends Control
    {

        public function SelectViewControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            var _loc_3:Object = null;
            var _loc_4:Object = null;
            var _loc_5:Object = null;
            if (param1.getName() == "selectView")
            {
                if (param2.property == "selectRole")
                {
                    ModelProxy.change("data", "selectPlayer", param2.newvalue);
                    target.selectRole(param2.newvalue);
                }
                else if (param2.property == "clearSelect")
                {
                    _loc_3 = UserData.getUserData();
                    if (_loc_3.mapid != 10521)
                    {
                        ModelProxy.change("data", "selectPlayer", null);
                        target.clearSelect();
                    }
                }
                else if (param2.property == "update")
                {
                    target.updateRole(param2.newvalue);
                }
                else if (param2.property == "addSkillBuffer")
                {
                    target.addSkillBuffer(param2.newvalue);
                }
                else if (param2.property == "removeSkillBuffer")
                {
                    target.removeSkillBuffer(int(param2.newvalue));
                }
                else if (param2.property == "diaoxianghp")
                {
                    _loc_4 = ConfigDictionary.data.monster[1600];
                    _loc_5 = {level:_loc_4.level, name:_loc_4.name, mid:1600, type:13, ability:{hp:param2.newvalue.hp, maxHp:param2.newvalue.maxHp}};
                    if (param2.newvalue.hp / param2.newvalue.maxHp < 0.3)
                    {
                        ModelProxy.change("movetips", "error", "雕像血量已经低于危险值，请注意保护雕像");
                    }
                    target.selectRole(_loc_5);
                }
            }
            return;
        }// end function

    }
}
